<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        .clearfix:after{
            /*在标签后面加内容的作用*/
            content: '';
            display: block;
            clear: both;
        }
        .item{
            float: left;
            height: 100px;
            width: 200px;
            border: 1px solid black;
        }
    </style>
</head>
<body>
<div class="clearfix">
    <div class="item">1</div>
    <div class="item">2</div>
    <div class="item">3</div>
<!--    相当于:-->
<!--    <div class="clear:both"></div>-->
</div>

</body>
</html>